<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Comment extends Model
{
    protected $fillable=['user_id','post_id','content'];

    //评论所属文章
    public function post()
    {
        return $this->belongsTo('App\Models\Post','post_id','id');
    }
    //评论所有者
    public function user()
    {
        return $this->belongsTo('App\Models\User','user_id','id');
    }
}
